package com.licw.mapper;

import com.licw.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {

    /**
     * 根据id更新商品数量
     */
    void updateNumberById(ShoppingCart shoppingCart);

    /**
     * 插入商品
     */
    void insert(ShoppingCart shoppingCart);

    /**
     * 条件查询
     */
    List<ShoppingCart> list(ShoppingCart shoppingCart);
    /**
     * 根据用户id查询
     */
    List<ShoppingCart> listByUserId(Long currentId);

    /**
     * 条件删除商品
     */
    void delete(ShoppingCart shoppingCart);

    void deleteByUserId(Long userId);
}